using UnityEngine;
using System.Collections;

public class SpecialGround : MonoBehaviour
{
	public bool positive = true;
	
	private DetectorCollider detector;
	
	void Start ()
	{
		detector = GetComponent<DetectorCollider>();
	}
	
	void Update ()
	{
		if(!detector.IsFree)
		{
			foreach(GameObject g in detector.GetObjects)
			{
				if(positive)
				{
					g.GetComponent<PlayerCharacterBehaviour>().onGroundUp = true;
				}
				else
				{
					g.GetComponent<PlayerCharacterBehaviour>().onGroundDown = true;
				}
			}
		}
	}
}
